package behavioral.interpreter;

/**
 * @ClassName: TerminalExpression
 * @Description: 终结符表达式：用于解释了语言中的终结符
 * @Author: liu-hao
 * @Date: 2023-04-12 10:25
 * @Version: 1.0
 **/
public class TerminalExpression implements Expression {

    private String variable;

    public TerminalExpression(String variable) {
        this.variable = variable;
    }

    @Override
    public int interpret(Context context) {
        return context.getValue(variable);
    }
}
